<?php
/*
 * @Desc: 
 * @Author: 小超越
 * @LastEditors: 小超越
 * @BlogUrl: www.zhe94.com
 */

namespace app\admin\model\article;

use think\Model;
use think\model\concern\SoftDelete;

class Category extends Model
{
    protected $table = 'article_category';
    use SoftDelete;
    protected $deleteTime = "delete_time";
    /**
     * @description: 获取分页后的对象数据
     * @param {type} 
     * @return object 
     */
    public function getObjByWhere($where,$limit = 10,$field='*')
    {
        $result = $this->field($field)->order('id', 'desc')->where($where)->paginate($limit);
        return $result;
    }
    /**
     * @description: 获取分类数组
     * @param {type} 
     * @return array
     */
    public function getDataByWhere($where=[],$field='*')
    {
        $result = $this->field($field)->where($where)->select()->toArray();
        return $result;
    }
}